﻿@model AutomatedTestDataManagement.Models.Page

@{
    ViewBag.Title = "Create";
}

<h2>Create Page</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Page</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.PageName, "Page Name")
        </div>
        <div class="editor-field">
            @if (ViewBag.SiteID != null)
            {
                <input type="hidden" name="SiteID" id="SiteID" value="@ViewBag.SiteID" />
            }
            @Html.EditorFor(model => model.PageName)
            @Html.ValidationMessageFor(model => model.PageName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PagePath, "Relative Path")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PagePath)
            @Html.ValidationMessageFor(model => model.PagePath)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @if (ViewBag.SiteID != null)
    {
        @Html.ActionLink("Return to Site", "Edit", "Site", new { id = ViewBag.SiteID }, null)
    }
    @Html.ActionLink("View All Sites", "Index", "Site") |
    @Html.ActionLink("View All Pages", "Index", "Page") |
    @Html.ActionLink("View All Fields", "Index", "HTMLField")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
